< previous page page_528 next page >

Page 528
z0548-01.gif
Figure 14.39
Surfaces created with transformations that scale
horizontally and translate vertically.
Figure 14.39 shows two transformation surfaces. The base curve for the surface on the left is a square in the X-Z plane centered on the origin. The base curve for the surface on the right is a circle in the X-Z plane with center at (2, 0, 2). Both surfaces use the same set of transformations that scale horizontally and translate vertically.
The transformations used to produce Figure 14.39 were created and stored in the Transformations array by the following code. Later, when the program was ready to display the surfaces, it used the Transformed3d object's SetTransformation routine to copy the transformations into the Transformed3d object.
e10a6a0a59f035e870d90cca05b85fce.gif
NumTrans = 18
ReDim Trans(1 To NumTrans)
dtheta = PI / 12
For i = 1 To NumTrans
    y =i /4
    theta = i * dtheta 
    R = 1 + Sin(2 * theta) / 2
    m3Scale A, R, 1, R       ' Scale. 
    m3Translate B, 0, y, 0   ' Translate.
    m3MatMultiply Trans(i).M, A, B  ' Combine.
Next i
Figure 14.40 shows two transformation surfaces created with a set of transformations that rotate around the Y axis and translate vertically. The base curve for the surface on the left was a semicircle in the X-Z plane centered at the origin. The base curve for the surface on the right was a circle in the X-Z plane with center at (2, 0, 2).
Many transformation surfaces are self-intersecting and quite bizarre. Figure 14.41 shows two surfaces generated by transformations that rotate around the Z axis and

 
< previous page page_528 next page >